![]() |
YNQ
YNQ-1.6.2
|
Data Structures | |
| struct | CMCrypterList |
Typedefs | |
| typedef void(* | CMAbstractHasher )(const NQ_BYTE *dataIn, NQ_BYTE *dataOut, NQ_COUNT length) |
| typedef void(* | CMAbstractCipher )(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_BYTE *buffer, NQ_COUNT bufferSize) |
| typedef void(* | CMAbstractIOCipher )(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_BYTE *buffer, NQ_COUNT bufferSize) |
| typedef void(* | CMAbstractHasher512 )(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_IOBufPos buffer, NQ_COUNT bufferSize, NQ_BYTE *ctxBuff) |
| typedef void(* | CMAbstractCcmEncryption )(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, NQ_BYTE *auth) |
| typedef NQ_BOOL(* | CMAbstractCcmDecryption )(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, const NQ_BYTE *auth) |
| typedef void(* | CMAbstractGcmEncryption )(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, NQ_BYTE *auth, NQ_BYTE *keyBuffer, NQ_BYTE *encMsgBuffer) |
| typedef NQ_BOOL(* | CMAbstractGcmDecryption )(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, const NQ_BYTE *auth, NQ_BYTE *keyBuffer, NQ_BYTE *msgBuffer) |
Functions | |
| void | cmSetExternalCrypters (const CMCrypterList *crypters) |
| void | cmResetExternalCrypters (void) |
This function prototype designates an abstract cryptographic hash algorithm. It is used to replace internal NQ encryption with an external one.
| dataIn | Pointer to the data to encrypt. |
| dataOut | Pointer to the buffer for encrypted. |
| length | Length of the incoming data and also the length of the encrypted data. |
| typedef void(* CMAbstractCipher)(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_BYTE *buffer, NQ_COUNT bufferSize) |
This function prototype designates an abstract cryptographic algorithm using a cryptographic key. It is used to replace internal NQ encryption with an external one.
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| dataFragments | A pointer to the array of data fragment descriptors. For encryption algorithms which allow encrypting multiple fragments, this array may contain more than one element. For other algorithms, only the first element is used. An element may be NULL. Also a data pointer in an element may be NULL as well as blob length may be zero. In either of those cases the respective fragment is ignored. |
| numFragments | Number of data fragments (see above). |
| buffer | Place holder for hash result. |
| bufferSize | The expected length of the encrypted data |
| typedef void(* CMAbstractIOCipher)(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_BYTE *buffer, NQ_COUNT bufferSize) |
This function prototype designates an abstract cryptographic algorithm using a cryptographic key. It is used to replace internal NQ encryption with an external one.
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| dataFragments | A pointer to the array of data fragment descriptors. For encryption algorithms which allow encrypting multiple fragments, this array may contain more than one element. For other algorithms, only the first element is used. An element may be NULL. Also a data pointer in an element may be NULL as well as blob length may be zero. In either of those cases the respective fragment is ignored. |
| numFragments | Number of data fragments (see above). |
| buffer | Place holder for hash result. |
| bufferSize | The expected length of the encrypted data |
| typedef void(* CMAbstractHasher512)(const CMBlob *key, const CMBlob *key1, const CMIOBlob dataFragments[], NQ_COUNT numFragments, NQ_IOBufPos buffer, NQ_COUNT bufferSize, NQ_BYTE *ctxBuff) |
This function prototype designates an abstract cryptographic algorithm for both encryption and producing authentication data (CCM) . It is used to replace internal NQ encryption with an external one.
This algorithm assumes that there are two blocks of data:
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| prefix | A pointer to the message prefix descriptor. This data participate in authentication but remains as is, without encryption. |
| message | Pointer to the message descriptor. This message will be encrypted in-place. |
| auth | Pointer to the authentication data. It will be filled as the result of the algorithm. |
| typedef void(* CMAbstractCcmEncryption)(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, NQ_BYTE *auth) |
This function prototype designates an abstract cryptographic algorithm for producing authentication data. It is used to replace internal NQ encryption with an external one. The authentication (hash result) is a product of all data blocks.
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| dataFragments | A pointer to the array of data fragment descriptors. For encryption algorithms which allow encrypting multiple fragments, this array may contain more than one element. For other algorithms, only the first element is used. An element may be NULL. Also a data pointer in an element may be NULL as well as blob length may be zero. In either of those cases the respective fragment is ignored. |
| numFragments | Number of data fragments (see above). |
| buffer | Place holder for hash result. |
| bufferSize | The expected length of the encrypted data |
| ctxBuff | Buffer for context data. if this buffer is null, context buffer will be allocated in function. |
| typedef NQ_BOOL(* CMAbstractCcmDecryption)(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, const NQ_BYTE *auth) |
This function prototype designates an abstract cryptographic algorithm for both decryption and authentication (CCM) . It is used to replace internal NQ encryption with an external one.
This algorithm assumes that there are two blocks of data:
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| prefix | A pointer to the message prefix descriptor. This data participate in authentication but remains as is, without encryption. |
| message | Pointer to the message descriptor. This message will be encrypted in-place. |
| auth | Pointer to the authentication data. This value is be used to authenticate. |
| typedef void(* CMAbstractGcmEncryption)(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, NQ_BYTE *auth, NQ_BYTE *keyBuffer, NQ_BYTE *encMsgBuffer) |
This function prototype designates an abstract cryptographic algorithm for both encryption and producing authentication data (GCM) . It is used to replace internal NQ encryption with an external one.
This algorithm assumes that there are two blocks of data:
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| prefix | A pointer to the message prefix descriptor. This data participate in authentication but remains as is, without encryption. |
| message | Pointer to the message descriptor. This message will be encrypted in-place. |
| auth | Pointer to the authentication data. It will be filled with the result of the algorithm. |
| keyBuffer,: | Optional buffer for usage in key calculations. If NULL a buffer will be allocated per function call. size - AES_PRIV_SIZE |
| ncMsgBuffer | Optional buffer for the message encryption which is not done in place. If NULL a buffer will be allocated per function call. size: message size. |
| typedef NQ_BOOL(* CMAbstractGcmDecryption)(const CMBlob *key, const CMBlob *key1, const CMIOBlob *prefix, CMIOBlob *message, const NQ_BYTE *auth, NQ_BYTE *keyBuffer, NQ_BYTE *msgBuffer) |
This function prototype designates an abstract cryptographic algorithm for both decryption and authentication (GCM). It is used to replace internal NQ encryption with an external one.
This algorithm assumes that there are two blocks of data:
| key | Pointer to the encryption key descriptor. Some algorithms do not use this value. |
| key1 | Pointer to the auxiliary key descriptor. This value may be NULL. Also the data pointer may be null as well as the blob length may be zero. In either of those cases the auxiliary key is ignored. Some algorithms may ignore this value anyway. |
| prefix | A pointer to the message prefix descriptor. This data participate in authentication but remains as is, without encryption. |
| message | Pointer to the message descriptor. This message will be encrypted in-place. |
| auth | Pointer to the authentication data. This value is be used to authenticate. |
| keyBuffer,: | Optional buffer for usage in key calculations. If NULL a buffer will be allocated per function call. size - AES_PRIV_SIZE |
| msgBuffer,: | Optional buffer for the message decryption which is not done in place. If NULL a buffer will be allocated per function call. Size - message size. |
| void cmSetExternalCrypters | ( | const CMCrypterList * | crypters | ) |
This function replaces internal NQ cryptographic algorithms with external ones.
| crypters | A pointer to the list of internal ciphers. Only non-NULL values are applied. |
| void cmResetExternalCrypters | ( | void | ) |
This function reverts the list of cryptographic algorithms to internal algorithms only.